package com.di.main;

import com.di.model.Animal;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 * Bean animal
 * 基于setter注入
 *
 * @author luowj12
 * @since 2021/6/16 9:18
 */
public class TestAnimalMain {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        Animal user = (Animal) context.getBean("animal");
        user.getCat().shout();
        user.getDog().shout();
    }

}
